# -*- coding: utf-8 -*-
import time


class Timer:
    def __enter__(self):
        self.start = time.time()
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        print(exc_type, exc_val, exc_tb)
        end = time.time()
        print(end - self.start)


with Timer() as t:
    print(t.start)
    _ = 1000 * 1000
    # _ = 100/0
